<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>为Vue组件传递数据——变量</title>
    <!-- 引入vue.js -->
    <script src="vue/vue.js"></script>
</head>

<body>
    <div id="app-7">
        <input type="text" v-model="myName">
        <say-hello :pname="myName"></say-hello>
    </div>
    <script>

        Vue.component('say-hello', {
            props: ['pname'],
            template: '<div><p>你好，{{pname}}</p></div>'
        })

        var app7 = new Vue({
            el: '#app-7',
            data: {
                myName: 'vue.js'
            }
        })
    </script>
</body>

</html>
